package com.example.util;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

@Component
public class RedisUtils {

//    @Resource
    @Autowired
    private static StringRedisTemplate stringRedisTemplate;

    public static void addString(String key,String value){
        stringRedisTemplate.opsForValue().set(key,value);
    }

    public static void getString(String key){
        stringRedisTemplate.opsForValue().get(key);
    }

}
